package com.azdebugit.clone.copy.cp.constructors;

/**
 * @Author: itdebug
 *
 * @version:: design_pattern_and_otherutils
 * @description:
 * @create: 2021/10/24 20:16.
 */
public class TestMain {
    public static void main(String[] args) {
        DeepCopyExample example = new DeepCopyExample();
        example.child = new Child("Example");

        DeepCopyExample copy = example.copy();
        if (copy != null) {
            copy.child.name = "Copied";
            System.out.println("example.child=" + example.child + ";\ncoppppy.child=" + copy.child);
        }
//输出结果：example.child=Child [name=Example];copy.child=Child [name=Copied]
    }
}
